package com.kylin.common.exception;

/**
 * 业务系异常
 * 此种异常属业务逻辑部分，因而应该显式抛出，使系统能够按业务逻辑应对处理
 * @author liangzh
 *
 */
public class BusinessException extends Exception {

    
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Object values[];
	
	private String aMessageKey;
	
    public BusinessException()
    {
    }

    public BusinessException(Throwable cause)
    {
        super(cause);
    }

    public BusinessException(String aMessageKey)
    {
        super(aMessageKey);
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Object value0)
    {
        super(aMessageKey);
        values = (new Object[] { value0 });
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Object value0, Object value1)
    {
        super(aMessageKey);
        values = (new Object[] { value0, value1 });
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Object values[])
    {
        super(aMessageKey);
        this.values = values;
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Throwable cause)
    {
        super(aMessageKey, cause);
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Throwable cause, Object value0)
    {
        super(aMessageKey, cause);
        values = (new Object[] { value0 });
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Throwable cause, Object value0, Object value1)
    {
        super(aMessageKey, cause);
        values = (new Object[] { value0, value1 });
        this.aMessageKey = aMessageKey;
    }

    public BusinessException(String aMessageKey, Throwable cause, Object values[])
    {
        super(aMessageKey, cause);
        this.values = values;;
        this.aMessageKey = aMessageKey;
    }

	public Object[] getValues(){
	    return values;
	}
	
	public String getaMessageKey(){
	    return aMessageKey;
	}
}

